package Homework7;

import java.util.*;

public class Homework7_1_TestGeometricFigure {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        double radius,height,width,side;
        radius = input.nextDouble();
        Circle circle = new Circle(radius);
        printGeometricFigure(circle);
        height = input.nextDouble();
        width = input.nextDouble();
        Rectangle rectangle = new Rectangle(height,width);
        printGeometricFigure(rectangle);
        side = input.nextDouble();
        Square square = new Square(side);
        printGeometricFigure(square);
        side = input.nextDouble();
        EquilateralTriangle equilateralTriangle = new EquilateralTriangle(side);
        printGeometricFigure(equilateralTriangle);
    }
    public static void printGeometricFigure(GeometricFigure geo){
        System.out.print(geo.getClass().getSimpleName() +": ");
        System.out.print("area = " + geo.getArea() + " ");
        System.out.println("perimeter = " + geo.getPerimeter());
    }
}
